package com.ajieee.merge.runner.finance.dto;

import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.NumberFormat;
import lombok.Data;

import java.time.LocalDate;

/**
 * @author ajieee
 * @date 2025-10-13
 */
@Data
public class StockQuoteExcelModel {

	@ExcelProperty("交易日期")
	private LocalDate dataDate;

	@ExcelProperty("证券代码")
	private String stockCode;

	@ExcelProperty("前收")
	private Double preClose;

	@ExcelProperty("开盘")
	private Double open;

	@ExcelProperty("最高")
	private Double high;

	@ExcelProperty("最低")
	private Double low;

	@ExcelProperty("今收")
	private Double close;

	@ExcelIgnore
	private Double change;

	@ExcelProperty("涨跌幅（%）")
	private Double changeRatio;

	@ExcelProperty("成交量(万股)")
	@NumberFormat(",##0.0###")
	private Double volume;

	@ExcelProperty("成交金额(万元)")
	@NumberFormat(",##0.0###")
	private Double amount;

	public Double getVolume() {
		return this.volume == null ? null : this.volume * 10000;
	}

	public Double getAmount() {
		return amount == null ? null : amount * 10000;
	}

	public Double getChange() {
		return close - preClose;
	}
}
